package com.itheima.HomeWork.homework04;

import java.io.File;
import java.util.Scanner;

public class Demo {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("输入路径：");
        String lj = sc.nextLine();
        System.out.println("wj:");
        String fname = sc.nextLine();
        File f = new File(lj);
        getF(f, fname);
    }
    public static void getF(File f, String fname) {
        File[] files = f.listFiles();
        for (File file : files) {
            System.out.println(file);
            }
            for (File file : files) {
                if (fname.contains(file.getName())) {
                    System.out.println(file.length());
                    System.out.println(file.getAbsoluteFile());
                    System.out.println(file.getName());
                }
        }
    }
}
